# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Dataform.V1beta1.Model.ReleaseConfig do
  @moduledoc """
  Represents a Dataform release configuration.

  ## Attributes

  *   `codeCompilationConfig` (*type:* `GoogleApi.Dataform.V1beta1.Model.CodeCompilationConfig.t`, *default:* `nil`) - Optional. If set, fields of `code_compilation_config` override the default compilation settings that are specified in dataform.json.
  *   `cronSchedule` (*type:* `String.t`, *default:* `nil`) - Optional. Optional schedule (in cron format) for automatic creation of compilation results.
  *   `disabled` (*type:* `boolean()`, *default:* `nil`) - Optional. Disables automatic creation of compilation results.
  *   `gitCommitish` (*type:* `String.t`, *default:* `nil`) - Required. Git commit/tag/branch name at which the repository should be compiled. Must exist in the remote repository. Examples: - a commit SHA: `12ade345` - a tag: `tag1` - a branch name: `branch1`
  *   `internalMetadata` (*type:* `String.t`, *default:* `nil`) - Output only. All the metadata information that is used internally to serve the resource. For example: timestamps, flags, status fields, etc. The format of this field is a JSON string.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Identifier. The release config's name.
  *   `recentScheduledReleaseRecords` (*type:* `list(GoogleApi.Dataform.V1beta1.Model.ScheduledReleaseRecord.t)`, *default:* `nil`) - Output only. Records of the 10 most recent scheduled release attempts, ordered in descending order of `release_time`. Updated whenever automatic creation of a compilation result is triggered by cron_schedule.
  *   `releaseCompilationResult` (*type:* `String.t`, *default:* `nil`) - Optional. The name of the currently released compilation result for this release config. This value is updated when a compilation result is automatically created from this release config (using cron_schedule), or when this resource is updated by API call (perhaps to roll back to an earlier release). The compilation result must have been created using this release config. Must be in the format `projects/*/locations/*/repositories/*/compilationResults/*`.
  *   `timeZone` (*type:* `String.t`, *default:* `nil`) - Optional. Specifies the time zone to be used when interpreting cron_schedule. Must be a time zone name from the time zone database (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). If left unspecified, the default is UTC.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :codeCompilationConfig =>
            GoogleApi.Dataform.V1beta1.Model.CodeCompilationConfig.t() | nil,
          :cronSchedule => String.t() | nil,
          :disabled => boolean() | nil,
          :gitCommitish => String.t() | nil,
          :internalMetadata => String.t() | nil,
          :name => String.t() | nil,
          :recentScheduledReleaseRecords =>
            list(GoogleApi.Dataform.V1beta1.Model.ScheduledReleaseRecord.t()) | nil,
          :releaseCompilationResult => String.t() | nil,
          :timeZone => String.t() | nil
        }

  field(:codeCompilationConfig, as: GoogleApi.Dataform.V1beta1.Model.CodeCompilationConfig)
  field(:cronSchedule)
  field(:disabled)
  field(:gitCommitish)
  field(:internalMetadata)
  field(:name)

  field(:recentScheduledReleaseRecords,
    as: GoogleApi.Dataform.V1beta1.Model.ScheduledReleaseRecord,
    type: :list
  )

  field(:releaseCompilationResult)
  field(:timeZone)
end

defimpl Poison.Decoder, for: GoogleApi.Dataform.V1beta1.Model.ReleaseConfig do
  def decode(value, options) do
    GoogleApi.Dataform.V1beta1.Model.ReleaseConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Dataform.V1beta1.Model.ReleaseConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
